/*****************************************************************************
 *   Copyright 2005 Tim A Wang
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 *
 ****************************************************************************/

package com.jb.identity.domain;

import com.jb.framework.database.Predicate;
import com.jb.web.context.WebContext;
import com.jb.framework.ModelBean;
import com.jb.framework.PersistentManagerRegistry;
import java.util.List;

public class Group extends ModelBean {
    private String nickName;
    private String category;
    private String type;
    private String moderator;
    private String permission;

    public static List getGroups(WebContext ctx, String userName) {
        return PersistentManagerRegistry.find(Group.class, new Predicate("me", userName, "="));
    }

    public String getUserName() {
        return getId();
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getNickName() {
        return nickName;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getCategory() {
        return category;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getType() {
        return type;
    }

    public void setModerator(String moderator) {
        this.moderator = moderator;
    }

    public String getModerator() {
        return moderator;
    }

    public void setPermission(String permission) {
        this.permission = permission;
    }

    public String getPermission() {
        return permission;
    }
}
